package win;

/**
 * Created with IntelliJ IDEA.
 * ClassName: BinarySearch
 * Package: win
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-08-21
 * Time: 19:27
 */

//数组的反转
public class Reversal {
    public static void main(String[] args) {

        int[] arr = {1, 2, 3, 4, 5, 6, 7};

        System.out.println(arr.length);

        int tmp;
        for (int i = 0; i < arr.length / 2; i++) {
            tmp = arr[i];
            arr[i] = arr[arr.length - 1 - i];
            arr[arr.length - 1 - i] = tmp;
        }

        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
        System.out.println();

    }
}
